package com.youxue.teachin.set.child.area;

import java.util.List;

import com.library.uiframework.mvp.PagingDataLoadPresenter;
import com.library.uiframework.mvp.PagingDataLoadView;
import com.youxue.teachin.common.utils.DefaultSubscriber;
import com.youxue.teachin.set.child.area.vo.AreaVO;
import rx.Observable;

/**
 * 区域选择
 *
 * @author: zhiwei
 * @date: 2017-10-07 18:00
 * @version: 9.1.0
 */
public class ChageAreaPresenter extends PagingDataLoadPresenter<PagingDataLoadView> {
    /**
     * @param pageDataLoadingView pageDataLoadingView
     */
    protected ChageAreaPresenter(PagingDataLoadView pageDataLoadingView) {
        super(pageDataLoadingView);
    }

    @Override
    protected void load(int page, boolean force) {
        Observable<List<AreaVO>> observable = new AreaUserCase().getAreasInfo();
        execute(observable, new DefaultSubscriber<List<AreaVO>>() {
            @Override
            public void onNext(List<AreaVO> areaVOs) {
                super.onNext(areaVOs);
                handleLoadSuccess(areaVOs, 1, 1);
            }
        });
    }
}
